<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="stylesheet" href="css/test.css">
</head>
<body>
    <img class="login_img" src="img/img_ceshi@2x.png" alt="">
    <div class="btn" id="star_btn">开始测试</div>
    <div class="login_alert">
        提示：本次测试共计十道题，预计花费您十分钟
    </div>
    <!--<div id="dalsdja_1"></div>-->
    <!--<div id="dalsdja_2"></div>-->
    <!--<div id="dalsdja_3"></div>-->
</body>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="js/rem.js"></script>
<script src="js/test.js"></script>
<script>
    var test =navigator.userAgent;
//    var test ='Mozilla/5.0 (Linux; Android 5.1; MX5 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.146 Mobile Safari/537.36<zqcj{"curriculum_id":"4","test_url":"http://dev.zqcj.net.cn/static/questions/loginTest.html","token":"452c3d5b233f0c164aaf69048c99b6e1","uid":"24","video_id":"11"}';
    var data = test.split("<zqcj")[test.split("<zqcj").length-1];
//    $('#dalsdja_2').html('截取'+data)
    if(typeof(window.localStorage.appData)== 'undefined'){
        console.log('没有')
//        $('#dalsdja_1').html('空',window.localStorage.appData)
        window.localStorage.appData = data;
    }else {
        console.log('有')
        var dataList = JSON.parse(window.localStorage.appData);
//        dataList.vadioChange = true;
        var newList = JSON.parse(data);
        if(dataList.video_id == newList.video_id&&dataList.curriculum_id == newList.curriculum_id){
//            console.log('相同')
//            $('#dalsdja_2').html('缓存已有，id相同'+ JSON.stringify(newList)+'原来'+JSON.stringify(dataList))
            window.localStorage.appData = JSON.stringify(dataList);
        }else {
//            console.log('不相同')
//                $('#dalsdja_3').html('缓存已有，id不相同'+ JSON.stringify(newList)+'原来'+JSON.stringify(dataList))
            window.localStorage.appData =  JSON.stringify(newList);
        }

    }



//    $('#dalsdja_3').html('缓存'+window.localStorage.appData)
    $("#star_btn").on("touchstart",function(){
        window.localStorage.removeItem('time')
        window.location.href='page/questions.html'
    });
</script>
</html>